import request from '@/utils/request'

/**
 * 获取图片列表
 * @param id
 * @returns {AxiosPromise}
 */
export function getImage() {
    return request({
        url: '/image/get/',
        method: 'get'
    })
}

/**
 * 下载图片
 * @param path
 * @param fileUrl
 * @returns {AxiosPromise}
 */
export function downloadImage(path,fileUrl){
    return request({
        url: '/image/download',
        method: 'post',
        params: {
            path: path,
            fileUrl: fileUrl
        }
    })
}

/**
 * 下载图片
 * @param id
 * @returns {AxiosPromise}
 */
export function deleteById(id){
    return request({
        url: '/image/delete',
        method: 'post',
        params: {
            id: id
        }
    })
}

/**
 * 创建相册
 * @param data
 * @returns {AxiosPromise}
 */
export function create(data){
    return request({
        url: '/image/create',
        method: 'post',
        data: data
    })
}

/**
 * 查询全部相册
 * @returns {AxiosPromise}
 */
export function getxc(){
    return request({
        url: '/image/getxc',
        method: 'get',
    })
}

/**
 * 移动到相册
 * @param id
 * @param albumId
 */
export function remove(id,albumId){
    return request({
        url: '/image/remove',
        method: 'post',
        params: {
            id: id,
            albumId: albumId
        }
    })
}

/**
 * 点击图库查看
 * @param id
 * @returns {AxiosPromise}
 */
export function view(id){
    return request({
        url: '/image/view',
        method: 'get',
        params:{
            id:id
        }
    })
}
